package net.sky.oa.test.dao.ioffice;

import java.util.Date;
import java.util.List;

import javax.annotation.Resource;

import org.junit.Test;
import org.springframework.test.annotation.Rollback;

import net.sky.oa.dao.ioffice.OffNotepadDao;
import net.sky.oa.model.OffNotepad;
import net.sky.oa.model.SysEmployee;
import net.sky.oa.test.BaseTestCase;


public class OffNotepadDaoTestCase extends BaseTestCase{

	@Resource
	private OffNotepadDao offnotepaddao;
	
	@Test
	@Rollback(false)
	public void add(){
	OffNotepad notepad=new OffNotepad();
	notepad.setCreatetime(new Date());
	notepad.setLasttime(new Date());
	notepad.setStatus(1);
	notepad.setTitle("ok");
	notepad.setContent("ok");
	notepad.setUser(null);
    this.offnotepaddao.save(notepad);			
	}
	
	@Test
	@Rollback(false)
	public void find(){
     		
	 List<OffNotepad> notepadList=this.offnotepaddao.findAllNotepad();
	 for(OffNotepad off:notepadList)
	 {
		System.out.println("result: "+off.getTitle()); 
		System.out.println("result: "+off.getCreatetime().toString()); 
	 }
	}
}
